package 算法.LeetCode91.每日打卡题目;

import 算法.NiuKe.TreeNode;

/**
 * @author: 谢君臣
 * @create: 2021-02-15 13:53
 * @founction: XXXX
 */
public class day13 {
    public static void main(String[] args) {

    }
    public int maxDepth(TreeNode root) {
        if (root==null)
            return 0;
        else {
            int left = maxDepth(root.left);
            int right = maxDepth(root.right);
            return Math.max(left,right)+1;
        }
    }
}
